CC = gcc

TARGET = syntax_highlighter

INCLUDE = inc
SRCDIR = src
OBJDIR = obj

SRC = $(wildcard $(SRCDIR)/*.c)

OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) 

LIB = -lpthread

CFLAGS=-Wall -O3
# CFLAGS = -Wall -g

all: $(TARGET)

$(OBJ):$(OBJDIR)/%.o: $(SRCDIR)/%.c
	@mkdir -p $(OBJDIR)
	$(CC) -c $< -o $@ $(CFLAGS) -I $(INCLUDE) 

$(TARGET): $(OBJ) $(LIB)
	$(CC) -o $@ $^ 

.PHONY: clean

clean:
	rm -rf $(OBJDIR) $(TARGET) *.html *.log
#	rm -rf tmp/*